//
//  CleanCacheViewController.m
//  Learn
//
//  Created by zyl_macbookpro on 2024/4/1.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "CleanCacheViewController.h"

@interface CleanCacheViewController ()<UITableViewDelegate,UITableViewDataSource>

@property(nonatomic ,strong)UITableView *tableView;

@property(nonatomic ,strong)NSArray *titleArray;

@end

@implementation CleanCacheViewController
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self renderNavBarWithBackgroundImage:[UIImage imageWithColor:lClearColor] backgroundColor:lClearColor shadowColor:nil textAttributeDic:@{NSForegroundColorAttributeName:rgba(51, 51, 51, 1),NSFontAttributeName:MFontWithSize(18)} enableScrollEdgeAppearance:NO];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"清除缓存";
    // Do any additional setup after loading the view.
    [self setBackButtonIsHidden:NO];
    [self.view addSubview:self.tableView];
    self.view.backgroundColor = rgba(245, 245, 245, 1);
}
#pragma mark -UITableViewDelegate,UITableViewDelegate
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = nil;
    
    if (!cell)
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@""];
        cell.selectionStyle =UITableViewCellSelectionStyleNone;
    }
    cell.detailTextLabel.text = @"100MB";
    cell.detailTextLabel.textColor = rgba(51, 51, 51, 1);
    cell.textLabel.text = self.titleArray[indexPath.row];
    cell.textLabel.font = MFontWithSize(16);
    cell.textLabel.textColor = rgba(51, 51, 51, 1);
    cell.detailTextLabel.font = MFontWithSize(16);
    
    
   
    return cell;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.titleArray.count;
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 62;
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    
}
#pragma mark -getters and setters
-(UITableView *)tableView{
    if (!_tableView){
        _tableView =[[UITableView alloc] initWithFrame:CGRectMake(0, lTopBarHeight, lScreenWidth, lScreenHeight - lTopBarHeight) style:UITableViewStylePlain];
        [_tableView setDelegate:self];
        [_tableView setDataSource:self];
        _tableView.bounces = NO;
        [_tableView setBackgroundColor:lClearColor];
        [_tableView setSeparatorColor:rgba(229, 229, 229, 1)];
        [_tableView setSeparatorInset:UIEdgeInsetsMake(0, 10, 0, 0)];
    }
    
    return _tableView;
}
- (NSArray *)titleArray
{
    if (!_titleArray) {
        _titleArray = @[@"离线包文件",@"作业模版文件"];
    }
    return _titleArray;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
